package com.ay.selfservicemachine.base;

import android.content.Context;
import android.view.LayoutInflater;

import androidx.recyclerview.widget.RecyclerView;


import java.util.List;

public abstract class BaseRvAdapter<T> extends RecyclerView.Adapter {

    private Context context;
    private List<T> list;
    private LayoutInflater mLayoutInflater;
//    public OnRvItemClickListener onItemClickListener;

    public BaseRvAdapter(Context context, List<T> list) {
        this.context = context;
        this.list = list;
        this.mLayoutInflater = LayoutInflater.from(context);
    }

    @Override
    public int getItemCount() {
        if (list == null) {
            return 0;
        }
        return list.size();
    }

    public List<T> getListData() {
        return list;
    }

    public LayoutInflater getLayoutInflater() {
        return mLayoutInflater;
    }

    public Context getContext() {
        return context;
    }

//    public void setOnItemClickListener(OnRvItemClickListener onItemClickListener) {
//        this.onItemClickListener = onItemClickListener;
//    }
}
